﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WarehouseManagement.BusinessLogic.DTO;
using WarehouseManagement.DataAccess;

namespace WarehouseManagement.BusinessLogic.DTOConverter
{
    public class ExportConverter
    {
        public static Export Convert(ExportDTO dto)
        {
            return new Export()
            {
                ExportNumber = dto.ExportNumber,
                CreatedDate = dto.CreatedDate,
                CustomerId = dto.CustomerId,
                ExportDate = dto.ExportDate,
                ExportReason = dto.ExportReason,
                Id = dto.Id,
                Notes = dto.Notes
            };
        }

        public static ExportDTO Convert(Export entity)
        {
            return new ExportDTO()
            {
                ExportNumber = entity.ExportNumber,
                CreatedDate = entity.CreatedDate,
                CustomerId = entity.CustomerId,
                ExportDate = entity.ExportDate,
                ExportReason = entity.ExportReason,
                Id = entity.Id,
                Notes = entity.Notes
            };
        }

        public static ExportDetail Convert(ExportDetailDTO dto)
        {
            return new ExportDetail()
            {
                CreatedBy = dto.CreatedBy,
                CreatedDate = dto.CreatedDate,
                ExportId = dto.ExportId,
                ExportPrice = dto.ExportPrice,
                Id = dto.Id,
                IsCancelled = dto.IsCancelled,
                LastModifiedDate = dto.LastModifiedDate,
                LastModifiedUser = dto.LastModifiedUser,
                MerchandiseId = dto.MerchandiseId,
                OriginalPrice = dto.OriginalPrice,
                Quantity = dto.Quantity,
            };
        }

        public static ExportDetailDTO Convert(ExportDetail entity)
        {
            return new ExportDetailDTO()
            {
                CreatedBy = entity.CreatedBy,
                CreatedDate = entity.CreatedDate,
                ExportId = entity.ExportId,
                ExportPrice = entity.ExportPrice,
                Id = entity.Id,
                IsCancelled = entity.IsCancelled,
                LastModifiedDate = entity.LastModifiedDate,
                LastModifiedUser = entity.LastModifiedUser,
                MerchandiseId = entity.MerchandiseId,
                OriginalPrice = entity.OriginalPrice,
                Quantity = entity.Quantity,
            };
        }
    }
}
